import 'package:flutter/material.dart';
import 'package:flutter_framework/utils/dialog_utils.dart';

class TestCloseKBBGDialog extends StatefulWidget {
  const TestCloseKBBGDialog({super.key});

  @override
  State<TestCloseKBBGDialog> createState() => _TestCloseKBBGDialogState();
}

class _TestCloseKBBGDialogState extends State<TestCloseKBBGDialog> {
  @override
  void initState() {
    // TODO: implement initState
    var i = 0;

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("点击背景关闭蒙层"),
      ),
      body: Column(
        children: [
          TextButton(
            onPressed: () {
              DialogUtils.showBGDialog(
                context,
                child: Container(
                  height: 200,
                  color: Colors.white,
                ),
              );
            },
            child: Text("显示"),
          )
        ],
      ),
    );
  }
}
